package vl06.synchronisation;

class CounterThread extends Thread {
	// Object attributes
	private String threadName;
	private CentralCounter centralCounter;

	public CounterThread(String name, CentralCounter comm) {
		super(name);
		this.threadName = name;
		this.centralCounter = comm;
	}

	public void run() {
		for (int i = 0; i < 10; i++) {
			System.out.println("Count " + centralCounter.increment() + " ("
					+ threadName + ")");
		}
	}
}